Skip to content

test(string): cross-check checkSnakeCase against independent oracle (R50-T043) - #91

Open
aniruddha-bongale wants to merge 1 commit into
S-AI-Projects:masterfrom
aniruddha-bongale:student/e26b07f0827/R50-T043
Open

aniruddha-bongale wants to merge 1 commit into
S-AI-Projects:masterfrom
aniruddha-bongale:student/e26b07f0827/R50-T043

Conversation

@aniruddha-bongale

Copy link
Copy Markdown

Description

This PR addresses task R50-T043 for checkSnakeCase. It introduces independent reference-comparison regression tests comparing checkSnakeCase against an oracle and an explicit expected result table across 22 enumerated domain inputs, documents representative reference comparison behavior and precondition checks at Line 12 in String/CheckSnakeCase.js, and adds an automated check runner work/R50-T043/check.py.

Related Issue

Fixes: #43

Type of Change

  • Tests
  • Documentation
  • Refactoring / Maintenance

Changes Made

  • Documented representative reference comparison behavior and precondition checks in String/CheckSnakeCase.js citing Line 12 (if (typeof varName !== 'string')).
  • Expanded String/test/CheckSnakeCase.test.js:
    • Added stated fixture tests: smallest valid input "" (expected false) and ordinary input "docker_build" (expected true).
    • Added an independent reference oracle (referenceOracle) utilizing string splitting instead of regex.
    • Enumerated 22 distinct domain inputs comparing actual results to both the independent oracle and fixed expectation table.
    • Enforced precondition boundary tests asserting TypeError('Argument is not a string.') across 10 non-string input types.
  • Implemented automated check runner work/R50-T043/check.py and saved verifiable execution evidence in work/R50-T043/results.json.

Screenshots / Recordings

N/A (String utility algorithmic unit test suite)

Testing

  • Ran Prettier style checks: npx prettier --check String/CheckSnakeCase.js String/test/CheckSnakeCase.test.js work/R50-T043/results.json
  • Ran native Vitest suite: npm test -- String/test/CheckSnakeCase.test.js (38 tests passed)
  • Ran full repository test suite via pre-commit hook (346 test files, 12,005 tests passed)
  • Ran automated check runner: python3 work/R50-T043/check.py (all checks and tool version captures passed)

Checklist

  • I have tested my changes locally.
  • I have added or updated tests, if needed.
  • I have updated documentation, if needed.
  • I have followed the project's coding guidelines.
  • I have run the relevant tests and checks.
  • I have addressed previous review feedback, if applicable.

Additional Notes

  • Precondition source line 12 is explicitly cited in code comments, test descriptions, and automated check results.
  • Preserves the existing public API of checkSnakeCase while locking down contract behavior via independent cross-checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Aniruddha Bongale — R50-T043: Cross-check checkSnakeCase (CheckSnakeCase.js) [String/CheckSnakeCase.js]

1 participant